package org.example.factory.factory_method;

/**
 * @Author KEKE
 * @Date 2024/7/1 10:30
 * @Description 测试类
 * @Version 1.0
 */
public class Client {

    public static void main(String[] args) {
        //创建咖啡店对象
        CoffeeStore store = new CoffeeStore();
        //创建对象
        CoffeeFactory factory = new AmericanCoffeeFactory();
        store.setFactory(factory);


        //点咖啡
        Coffee coffee = store.orderCoffee();
        System.out.println(coffee.getName());
    }
}
